#pragma once
#include "wOHandle.hpp"
#include "ProObjects.h"
#include <memory>
#include "wCollection.hpp"
#include <ProSecerror.h>



namespace witotk{

	class wProWSecerror:public wOHandle<ProWSecerror>
	{
	public:
		wProWSecerror()
		{
			ProSecerrorAlloc(&m_data);
		}
		wProWSecerror(ProWSecerror obj):wOHandle<ProWSecerror>(obj)
		{
			ProSecerrorAlloc(&m_data);
		}
		~wProWSecerror()
		{
			ProSecerrorFree(&m_data);
		}

		void Add(ProSecerrCode   user_error,
			wchar_t        *msg,
			ProSecerrSever  user_severity = 0,
			int             user_ent_id = -1,
			ProSecerrAttr   user_attribute = 0)
		{
			ProError error = ProSecerrorAdd(&m_data, user_error, msg, user_severity, user_ent_id, user_attribute);
			PROE_THROW(error,"wProSecerror::Add");
		}
		
	};

	typedef	std::tr1::shared_ptr<wProWSecerror> wProWSecerror_ptr;

}